export interface ResponseData {
  code: number
  message: string
  ok?: boolean
}

//定义SKU对象的TS类型
export interface SkuData {
  category3Id: string | number
  spuId: string | number
  tmId: string | number
  skuName: string
  price: string | number
  weight: string | number
  skuDesc: string
  skuAttrValueList: skuAttrValue[]
  skuSaleAttrValueList: skuSaleAttrValue[]
  skuDefaultImg: string
  skuImageList?: skuImage[]
  isSale?: number
  id?: number
}

export interface skuAttrValue {
  id?: string | number
  valueName?: string
  attrId: string | number
  valueId: string | number
}

export interface skuSaleAttrValue {
  id?: string | number
  saleAttrValueName?: string
  saleAttrId: string | number
  saleAttrValueId: string | number
}

export interface skuImage {
  id?: number
  imgName?: string
  imgUrl?: string
}

//获取SKU接口返回的数据类型
export interface SkuResponseData extends ResponseData {
  data: {
    records: SkuData[]
    total: number
    size: number
    current: number
    searchCount: boolean
    pages: number
  }
}

//获取SKU商品详情接口的TS类型
export interface SkuInfoData extends ResponseData {
  data: SkuData
}
